package com.fruit.api.controller.fruit;

import com.fruit.bean.entity.fruit.FruitTypeInfo;
import com.fruit.bean.vo.front.Rets;
import com.fruit.service.fruit.FruitTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/fruit/type")
public class FruitTypeController {

    @Autowired
    private FruitTypeService typeService;

    /**
     * 获取水果类型列表
     * @return
     */
    @GetMapping("/list")
    public Object getFruitTypeList(){
        List<FruitTypeInfo> fruitTypeInfoList = typeService.queryAll();
        return Rets.success(fruitTypeInfoList);
    }

}
